/*
 Navicat Premium Data Transfer

 Source Server         : localDB
 Source Server Type    : MySQL
 Source Server Version : 50720
 Source Host           : localhost
 Source Database       : javaDB

 Target Server Type    : MySQL
 Target Server Version : 50720
 File Encoding         : utf-8

 Date: 05/04/2018 18:37:49 PM
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
--  Table structure for `Resource`
-- ----------------------------
DROP TABLE IF EXISTS `Resource`;
CREATE TABLE `Resource` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `playerId` int(10) NOT NULL,
  `name` varchar(20) CHARACTER SET utf8mb4 NOT NULL DEFAULT '新城市',
  `resourceMap` varchar(2500) CHARACTER SET utf8mb4 DEFAULT '{"food":10000,"steel":10000,"oil":10000,"mine":10000,"gold":1000}',
  `productPowerMap` varchar(2500) CHARACTER SET utf8mb4 DEFAULT '{"food":0,"steel":0,"oil":0,"mine":0,"gold":0}',
  `population` bigint(20) unsigned DEFAULT '0',
  `populationSurplus` bigint(20) DEFAULT '0',
  `officer` varchar(2500) CHARACTER SET utf8mb4 DEFAULT '{}',
  `army` varchar(2500) CHARACTER SET utf8mb4 DEFAULT '{}',
  `buildingsMap` varchar(2500) CHARACTER SET utf8mb4 DEFAULT '{}',
  `indorsationCount` int(3) DEFAULT '100',
  `complaintCount` int(3) DEFAULT '0',
  `tax` int(3) DEFAULT '0',
  `cityDefense` varchar(2500) CHARACTER SET utf8mb4 DEFAULT '{}',
  `localY` double(3,0) DEFAULT '0',
  `localX` double(3,0) DEFAULT '0',
  `resourceBuildingsMap` text CHARACTER SET utf8mb4,
  `lastUpdateTime` bigint(15) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `RESOURCE_INDEX` (`id`) USING BTREE,
  KEY `RESOURCE_PLAYERID` (`playerId`) USING BTREE,
  CONSTRAINT `RESOURCE_KEY` FOREIGN KEY (`playerId`) REFERENCES `UserEntity` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8;

-- ----------------------------
--  Records of `Resource`
-- ----------------------------
BEGIN;
INSERT INTO `Resource` VALUES ('16', '1', '战争', '{\"mine\":4500,\"gold\":\"1000\",\"steel\":4500,\"oil\":4500,\"food\":4500}', '{\"mine\":\"500\",\"gold\":\"0\",\"steel\":\"500\",\"oil\":500,\"food\":\"500\"}', '0', '0', '{}', '{}', '{}', '100', '0', '0', '{}', '0', '0', '{\"0\":\"{\\\"level\\\":\\\"1\\\",\\\"buildStartTime\\\":\\\"1525330801\\\",\\\"leftTime\\\":0,\\\"resourceType\\\":\\\"farmland\\\",\\\"buildStatus\\\":1}\",\"1\":\"{\\\"level\\\":\\\"1\\\",\\\"buildStartTime\\\":\\\"1525341215\\\",\\\"costSec\\\":\\\"50000\\\",\\\"leftTime\\\":0,\\\"resourceType\\\":\\\"mine\\\",\\\"buildStatus\\\":1}\",\"2\":\"{\\\"level\\\":\\\"1\\\",\\\"buildStartTime\\\":\\\"1525397406\\\",\\\"costSec\\\":\\\"5\\\",\\\"leftTime\\\":0,\\\"resourceType\\\":\\\"steelmill\\\",\\\"buildStatus\\\":1}\",\"3\":\"{\\\"level\\\":\\\"1\\\",\\\"buildStartTime\\\":\\\"1525397411\\\",\\\"costSec\\\":\\\"5\\\",\\\"leftTime\\\":0,\\\"resourceType\\\":\\\"oilfield\\\",\\\"buildStatus\\\":1}\"}', '1525425619');
COMMIT;

-- ----------------------------
--  Table structure for `UserEntity`
-- ----------------------------
DROP TABLE IF EXISTS `UserEntity`;
CREATE TABLE `UserEntity` (
  `id` int(11) NOT NULL,
  `passWord` varchar(255) COLLATE utf8_bin DEFAULT NULL,
  `userName` varchar(255) COLLATE utf8_bin DEFAULT NULL,
  `lastLoginTime` bigint(15) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  UNIQUE KEY `USER_NAME` (`userName`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

-- ----------------------------
--  Records of `UserEntity`
-- ----------------------------
BEGIN;
INSERT INTO `UserEntity` VALUES ('1', '1234', 'xiaoming', '1525421079');
COMMIT;

-- ----------------------------
--  Table structure for `Warehouse`
-- ----------------------------
DROP TABLE IF EXISTS `Warehouse`;
CREATE TABLE `Warehouse` (
  `id` int(11) NOT NULL,
  `playerId` int(11) NOT NULL,
  `resourceMap` varchar(2500) COLLATE utf8_bin DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

-- ----------------------------
--  Table structure for `productionList`
-- ----------------------------
DROP TABLE IF EXISTS `productionList`;
CREATE TABLE `productionList` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `title` varchar(300) COLLATE utf8_bin DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

-- ----------------------------
--  Records of `productionList`
-- ----------------------------
BEGIN;
INSERT INTO `productionList` VALUES ('1', 'flask'), ('2', 'wifi'), ('3', 'beer'), ('4', 'football'), ('5', 'basketball'), ('6', 'paper-plane'), ('7', 'american-football'), ('8', 'boat'), ('9', 'bluetooth'), ('10', 'build'), ('11', 'flask'), ('12', 'wifi');
COMMIT;

SET FOREIGN_KEY_CHECKS = 1;
